﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Tools
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TData"></typeparam>
    /// <typeparam name="TKey"></typeparam>
    public interface ITree<TData,TKey>
    {
        /// <summary>
        /// key
        /// </summary>
        public TKey Id { get; set; }
        /// <summary>
        /// 父节点
        /// </summary>
        public TKey ParentId { get; set; }
        /// <summary>
        /// 子节点集合
        /// </summary>
        public List<TData> Children { get; set; }
        /// <summary>
        /// 是否是跟节点
        /// </summary>
        /// <returns></returns>
        public bool IsRoot();
    }
}
